<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width,initial-scale=1,maximum-scale=1.0" />
    <title>api接口测试</title>
    <#include "/view/admin/head.html"/>
    <script type="text/javascript" src="${base}/jstool/jquery.form.js"></script>
    <script type="text/javascript" src="${base}/jstool/bootstrap-datetimepicker/js/bootstrap-datetimepicker.js"></script>
    <script type="text/javascript" src="${base}/jstool/bootstrap-datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js"></script>
    <link rel="stylesheet" type="text/css" href="${base}/jstool/bootstrap-datetimepicker/css/bootstrap-datetimepicker.min.css" />
    <script type="text/javascript" src="${base}/jstool/bootstrap-datetimepicker/js/bootstrap-datetimepicker.js"></script>
    <script type="text/javascript" src="${base}/jstool/bootstrap-datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js"></script>
    <link rel="stylesheet" type="text/css" href="${base}/jstool/bootstrap-datetimepicker/css/bootstrap-datetimepicker.min.css" />


    <script type="text/javascript" src="${base}/jstool/bootstrap-validator-0.5.3/js/bootstrapValidator.min.js"></script>
    <script type="text/javascript" src="${base}/jstool/bootstrap-validator-0.5.3/lang/zh_CN.min.js"></script>
    <link rel="stylesheet" type="text/css" href="${base}/jstool/bootstrap-validator-0.5.3/css/bootstrapValidator.min.css" />


    <style type="text/css">
        .list-path {
            height: 50px;
            line-height: 50px;
            background-color: #9acfea;
        }

        .table-class {
            width: 90%;
            text-align: center;
            border: 1px solid #afd9ee;
            margin: 0 auto;
            margin-top: 50px;
        }

        table th {
            width: 20%;
            background-color: #d9edf7;
            text-align: right;
        }

        table td {
            width: 20%;
            text-align: left;
        }


    </style>
    <script type="text/javascript">

        $(function(){
            //初始化







                $('#approveTimeStart').datetimepicker({language: 'zh-CN' });
                $('#approveTimeEnd').datetimepicker({language: 'zh-CN' });
                $('#createtimeStart').datetimepicker({language: 'zh-CN' });
                $('#createtimeEnd').datetimepicker({language: 'zh-CN' });





        });

    </script>
</head>
<body>

<div class="list-path">
		<span style="margin-left: 50px;"> <a
                href="${base}/czjcomments/list.do"><span
                class="glyphicon glyphicon-home"></span> 评论列表</a> / 评论接口测试
		</span>
    <div style="float: right; margin-right: 40px;">
        <a class="btn btn-info"
           href="${base}/czjcomments/list.do">返回上一级</a>
    </div>
</div>


<div class="table-class">
    <#include "/view/admin/opermsg.html"/>
        <form id="czjcommentsForm" action="#"
         >

            <table class="table table-bordered">


                    <tr>
                    <th>评论主键</th>
                    <td>
                        <div class="form-group">
                            <input type="text" class="form-control" id="commentsId" name="commentsId" placeholder="请输入评论主键" value="${entity.commentsId!}">
                        </div>
                    </td>
                    


                    
                    <th>评论内容</th>
                    <td>
                        <div class="form-group">
                            <input type="text" class="form-control" id="content" name="content" placeholder="请输入评论内容" value="${entity.content!}">
                        </div>
                    </td>
                    </tr>


                    <tr>
                    <th>回复数</th>
                    <td>
                        <div class="form-group">
                            <input type="text" class="form-control" id="replyCount" name="replyCount" placeholder="请输入回复数" value="${entity.replyCount!}">
                        </div>
                    </td>
                    


                    
                    <th>点赞数</th>
                    <td>
                        <div class="form-group">
                            <input type="text" class="form-control" id="likeCount" name="likeCount" placeholder="请输入点赞数" value="${entity.likeCount!}">
                        </div>
                    </td>
                    </tr>


                    <tr>
                    <th>评论对象</th>
                    <td>
                        <div class="form-group">
                            <input type="text" class="form-control" id="objectId" name="objectId" placeholder="请输入评论对象" value="${entity.objectId!}">
                        </div>
                    </td>
                    


                    
                    <th>评论对象类别</th>
                    <td>
                        <div class="form-group">
                            <select id="objectType" name="objectType"
                                    class="form-control"
                            >
                                <option value="">请选择评论对象类别</option>
                                                <option value="0" <#if entity.objectType??&&0 == entity.objectType>selected="selected"</#if>>活动</option>

                                                <option value="1" <#if entity.objectType??&&1 == entity.objectType>selected="selected"</#if>>商品</option>


                            </select>
                        </div>
                    </td>
                    </tr>


                    <tr>
                    <th>审批状态</th>
                    <td>
                        <div class="form-group">
                            <select id="approveStatus" name="approveStatus"
                                    class="form-control"
                            >
                                <option value="">请选择审批状态</option>
                                                <option value="0" <#if entity.approveStatus??&&0 == entity.approveStatus>selected="selected"</#if>>审批中</option>

                                                <option value="1" <#if entity.approveStatus??&&1 == entity.approveStatus>selected="selected"</#if>>审批通过</option>

                                                <option value="2" <#if entity.approveStatus??&&2 == entity.approveStatus>selected="selected"</#if>>审批不通过</option>


                            </select>
                        </div>
                    </td>
                    


                    
                    <th>审批时间开始时间</th>
                    <td>
                        <input type="text" class="form-control" value="<#if (entity.approveTimeStart)?? >${entity.approveTimeStart?string('yyyy-MM-dd HH:mm:ss')}</#if>" id="approveTimeStart" name="approveTimeStart" data-date-format="yyyy-mm-dd hh:ii:ss">
                    </td>
                    </tr>

                    <tr>
                    <th>审批时间结束时间</th>
                    <td>
                        <input type="text" class="form-control" value="<#if (entity.approveTimeEnd)?? >${entity.approveTimeEnd?string('yyyy-MM-dd HH:mm:ss')}</#if>" id="approveTimeEnd" name="approveTimeEnd" data-date-format="yyyy-mm-dd hh:ii:ss">
                    </td>
                    


                    
                    <th>创建时间开始时间</th>
                    <td>
                        <input type="text" class="form-control" value="<#if (entity.createtimeStart)?? >${entity.createtimeStart?string('yyyy-MM-dd HH:mm:ss')}</#if>" id="createtimeStart" name="createtimeStart" data-date-format="yyyy-mm-dd hh:ii:ss">
                    </td>
                    </tr>

                    <tr>
                    <th>创建时间结束时间</th>
                    <td>
                        <input type="text" class="form-control" value="<#if (entity.createtimeEnd)?? >${entity.createtimeEnd?string('yyyy-MM-dd HH:mm:ss')}</#if>" id="createtimeEnd" name="createtimeEnd" data-date-format="yyyy-mm-dd hh:ii:ss">
                    </td>
                    </tr>
        <tr>
            <td colspan="4" width="100%" style="text-align: center;">
                <a class="btn btn-success " href="javascript:apiList()" >获取评论列表接口</a>
                <span style="width: 20px;">&nbsp;</span>
                <a class="btn btn-success " href="javascript:apiDetail()" >获取评论详情接口</a>


            </td>
        </tr>
        <tr>
            <td colspan="4" width="100%" style="text-align: left;height: 400px;" >
                  <pre>
链接：<code  id="url"></code>
                </pre>
                <pre>
返回结果集：<code  id="output"></code>
                </pre>
            </td>
        </tr>
    </table>
        </form>



</div>

<script type="text/javascript">
    function jsonFormat(jsonStr){
        var res="";
        for(var i=0,j=0,k=0,ii,ele;i<jsonStr.length;i++)
        {//k:缩进，j:""个数
            ele=jsonStr.charAt(i);
            if(j%2==0&&ele=="}")
            {
                k--;
                for(ii=0;ii<k;ii++) ele="    "+ele;
                ele="\n"+ele;
            }
            else if(j%2==0&&ele=="{")
            {
                ele+="\n";
                k++;
                for(ii=0;ii<k;ii++) ele+="    ";
            }
            else if(j%2==0&&ele==",")
            {
                ele+="\n";
                for(ii=0;ii<k;ii++) ele+="    ";
            }
            else if(ele=="\"") j++;
            res+=ele;
        }
        return res;
    }


    function apiList(){

        var options = {
            target:        '#output',   // target element(s) to be updated with server response
            beforeSubmit:  showRequest,  // pre-submit callback
            success:       showResponse,  // post-submit callback

            // other available options:
            url:       "${base}/czjcomments/apiList.jn",         // override for form's 'action' attribute
            type:      "post",        // 'get' or 'post', override for form's 'method' attribute
            dataType:  "json"        // 'xml', 'script', or 'json' (expected server response type)
            //clearForm: true        // clear all form fields after successful submit
            //resetForm: true        // reset the form after successful submit

            // $.ajax options can be used here too, for example:
            //timeout:   3000
        };

        // 将myForm使用 'ajaxForm' 进行绑定
        $('#czjcommentsForm').ajaxForm(options);
        $('#url').text(options.url);

        $('#czjcommentsForm').submit();

    }
    function apiDetail(){
        var options = {
            target:        '#output',   // target element(s) to be updated with server response
            beforeSubmit:  showRequest,  // pre-submit callback
            success:       showResponse,  // post-submit callback

            // other available options:
            url:       '${base}/czjcomments/apiDetail.jn',         // override for form's 'action' attribute
            type:      "post",        // 'get' or 'post', override for form's 'method' attribute
            dataType:  "json"        // 'xml', 'script', or 'json' (expected server response type)
            //clearForm: true        // clear all form fields after successful submit
            //resetForm: true        // reset the form after successful submit

            // $.ajax options can be used here too, for example:
            //timeout:   3000
        };

        // 将myForm使用 'ajaxForm' 进行绑定
        $('#czjcommentsForm').ajaxForm(options);
        $('#url').text(options.url);
        $('#czjcommentsForm').submit();
    }
    function showRequest(formData, jqForm, options) {
        return true;
    }

    function showResponse(responseText, statusText, xhr, $form)  {

        $('#output').text(jsonFormat(JSON.stringify(responseText)));
    }


</script>


</body>
</html>
